package edu.uc.win;

import java.util.Date;

import org.junit.Test;

import edu.uc.bean.Logger;
import edu.uc.service.LoggerService;
import edu.uc.util.SpringUtil;

public class Start_Logger {

	private static LoggerService loggerService = SpringUtil.getBean(LoggerService.class);
	@Test
	public void testInsert(){
		for(int i=0;i<5;i++){
			Logger bean = new Logger();
			bean.setMessage("12345");
			bean.setInsertData(new Date());
			bean.setType("javaee");
			loggerService.insert(bean);
		}
	}
	
	@Test
	public void testUpdate(){
		Logger logger = new Logger();
		logger.setId(3L);
		logger.setInsertData(new Date());
		logger.setType("javaee");
		logger.setMessage("12365");
		loggerService.update(logger);
	}
	
	@Test
	public void testLoad(){
		Logger logger = loggerService.load(3L);
		System.out.println(logger.getMessage());
	}
	
	@Test
	public void testDelete(){
		System.out.println(loggerService.delete(3L));//返回1
	}
}
